from PIL import Image
import os

def figure_change(image_path):
    # 打开图片
    img = Image.open(image_path)

    # 缩小图片，设置目标分辨率
    new_width = 800
    new_height = 450
    img_resized = img.resize((new_width, new_height))

    new_image_path = os.path.join(os.path.dirname(__file__), "resized_image.jpg")
    # 保存新的图片
    img_resized.save(new_image_path)

    # 显示新图片
    # img_resized.show()
    
    return new_image_path
